blob: 4c5f83f1d3b584196b33468739169fdd6a8c28e2 [file] [log] [blame]
David Ostrovsky6842df92014-12-19 09:20:31 +01001= Inline Edit
2
3This page explains the workflow for creating and amending changes in the
4browser.
5
6
7[[create-change]]
David Pursehouse0a1da092015-01-30 15:08:17 +09008== Creating a New Change
David Ostrovsky6842df92014-12-19 09:20:31 +01009
10A new change can be created directly in the browser, meaning it is not necessary
11to clone the whole repository to make trivial changes.
12
David Pursehouse0a1da092015-01-30 15:08:17 +090013The new change is created as a draft change, unless
14link:config-gerrit.html#change.allowDrafts[change.allowDrafts] is set to false,
15in which case the change is created as a normal new change.
16
17There are two different ways to create a new change:
David Ostrovsky6842df92014-12-19 09:20:31 +010018
19By clicking on the 'Create Change' button in the project screen:
20
21[[create-change-from-project-info-screen]]
22
23image::images/inline-edit-create-change-project-screen.png[width=800, link="images/inline-edit-create-change-project-screen.png"]
24
25The user can select the branch on which the new change should be created:
26
27image::images/inline-edit-create-change-project-screen-dialog.png[width=800, link="images/inline-edit-create-change-project-screen-dialog.png"]
28
David Pursehouse0a1da092015-01-30 15:08:17 +090029By clicking the 'Follow-Up' button on the change screen, to create a new change
30based on the selected change.
David Ostrovsky6842df92014-12-19 09:20:31 +010031
32[[create-change-from-change-screen]]
33
34image::images/inline-edit-create-follow-up-change.png[width=800, link="images/inline-edit-create-follow-up-change.png"]
35
David Pursehouse66212092015-01-07 15:47:40 +090036[[editing-change]]
37== Editing Changes
38
39To switch to edit mode, press the 'Edit' button at the top of the file list:
40
41[[switch-to-edit-mode]]
42image::images/inline-edit-enter-edit-mode-from-file-list.png[width=800, link="images/inline-edit-enter-edit-mode-from-file-list.png"]
43
44While in edit mode, it is possible to add new files to the change by clicking
45the 'Add...' button at the top of the file list.
46
David Ostrovsky20514862015-05-04 08:00:54 +020047File changes can be reverted or files can be removed from the change or
48deleted files can be restored, by clicking the icons to the left of the file
49name.
David Pursehouse66212092015-01-07 15:47:40 +090050
51To switch from edit mode back to review mode, click the 'Done Editing' button.
52
53image::images/inline-edit-file-list-in-edit-mode.png[width=800, link="images/inline-edit-file-list-in-edit-mode.png"]
54
55[[open-full-screen-editor]]
56While in edit mode, clicking on a file name in the file list opens a full
57screen editor for that file.
58
59To save edits, click the 'Save' button or press `CTRL-S`. To return to the
60change screen, click the 'Close' button.
61
62image::images/inline-edit-full-screen-editor.png[width=800, link="images/inline-edit-full-screen-editor.png"]
63
64If there are unsaved edits when the 'Close' button is pressed, a dialog will
65pop up asking to confirm the edits.
66
67image::images/inline-edit-confirm-unsaved-edits.png[width=800, link="images/inline-edit-confirm-unsaved-edits.png"]
68
69To discard the unsaved edits and return to the change screen, click the 'OK'
70button. To continue editing, click 'Cancel'.
71
72[[switch-to-edit-mode-from-side-by-side]]
73
74While in review mode, it is possible to switch directly to edit mode and into an
75editor for a file under review by clicking on the edit icon in the patch set list
76on the side-by-side diff view.
77
78image::images/inline-edit-enter-edit-mode-from-diff.png[width=800, link="images/inline-edit-enter-edit-mode-from-diff.png"]
79
80[[reviewing-changes-made-in-change-edit]]
81== Reviewing Change Edits
82
83Change edits are reviewed in the same way as regular patch sets, using the
84side-by-side diff screen. Change edits are shown as 'edit' in the patch list
85on the diff screen:
86
87image::images/inline-edit-edit-in-diff-screen-patch-list.png[width=800, link="images/inline-edit-edit-in-diff-screen-patch-list.png"]
88
89and on the change screen:
90
91image::images/inline-edit-edit-in-patch-list.png[width=800, link="images/inline-edit-edit-in-patch-list.png"]
92
93Note that patch sets may exist that were created after the change edit was created.
94
95For example this sequence:
96
97`1 2 3 4 5 6 7 8 9 edit 10`
98
99means that the change edit was created on top of patch set number 9 and a regular
100patch set was uploaded later.
David Ostrovsky6842df92014-12-19 09:20:31 +0100101
David Ostrovsky66796092014-12-24 14:30:00 +0100102[[change-edit-actions]]
103== Change Edit Actions
104
105Change edits can be deleted, published and rebased, and a patch set that
106represents a change edit can be downloaded like a regular patch set.
107
108[[delete-change-edit]]
109
110There is a special ref for a change edit. When the change edit is deleted, this
111ref is deleted as well. To delete a change edit click on the "Delete Edit"
112button.
113
114[[publish-change-edit]]
115
116When a change edit is based on the current patch set, it can be published. By
117publishing a change edit it is promoted to a regular patch set. The special ref
118that represents the change edit is deleted on publish. To publish a change edit
119click on the "Publish Edit" button. This button is only shown when the change
120edit is based on the current patch set. Otherwise the change edit must first be
121rebased onto the current patch set.
122
123[[rebase-change-edit]]
124
125Only change edits that are based on the current patch set can be published. If
126in the meantime a new patch set was uploaded, the change edit must be rebased on
127top of the current patch set before it can be published. Rebasing a change
128edit is done by clicking on the "Rebase Edit" button. If the rebase results in
129conflicts, these conflicts cannot be resolved in the browser. In this case the
130change edit must be downloaded (see below) and the conflicts must be resolved in
131the local environment. The commit that contains the conflict resolution can then
132be uploaded by setting `edit` as option on the target ref:
133
134----
135 $ git push host HEAD:refs/for/master%edit
136----
137
138[[download-change-edit-patch]]
139
140Like regular patch sets, change edits can be downloaded by the download
141commands (e.g. provided by the `download-commands` plugin). To download a
142change edit, select the desired scheme from the "Download" dropdown and copy the
143command to your terminal. Note: only change edit owners and users that were
144granted the link:access-control.html#capability_accessDatabase[accessDatabase]
145global capability are able to access change edit refs.
146
David Ostrovsky99528702015-04-30 23:48:35 +0200147[[search-for-change-edits]]
148
149To search change edits from the UI the link:user-search.html#has[has:edit]
150predicate can be used.
151
David Ostrovskyd63920f2014-12-24 14:34:36 +0100152[[not-implemented-features]]
153== Not Implemented Features
154
155* [PENDING CHANGE]
156The inline editor uses settings decided from the user's diff preferences, but those
157preferences are only modifiable from the side-by-side diff screen. It should be possible
158to open the preferences also from within the editor.
159
160* Allow to rename files that are already contained in the change (from the file table).
161The same rename file dialog can be used with preselected and disabled original file
162name.
163
164* Changed files in change edit should be marked as changed in file table in edit mode.
165One option is to use dirty icon or "*" char in front of changed files, another option
166is to use different hyperlink color for changed files (red?), to avoid adding yet another
167column to the file table
168
169* Add navigation icons in header area of edit screen. When dozen files need to be changed
170in context of change edit, this is not the best workflow to open one file in edit screen,
171change it, save it, close edit screen and select next file from the file table to edit.
172"<-" | "->" icons in header of edit screen could be used to navigate to the next file to
173change from the file table. This would behave like the navigation icons in side by side
174with thefollowing logic on click:
175
176** "save-when-file-was-changed" or
177** "close-when-no-changes"
178
179* Allow to activate different key maps, supported by CM: Emacs, Sublime, Vim. Load key
180maps dynamically. Currently default mode is used.
181
182* Implement conflict resolution during rebase of change edit using inline edit
183feature by creating new edit on top of current patch set with auto merge content
184
185* Similarly, reuse inline edit feature for conflict resolution during rebase of regular
186patch sets
187
David Ostrovsky6842df92014-12-19 09:20:31 +0100188GERRIT
189------
190Part of link:index.html[Gerrit Code Review]
191
192SEARCHBOX
193---------